#-*- coding:utf-8 -*-

from house.models import Image 


def setUserImage(user, path, trade):
    imgs = Image.objects.filter(owner=user, relative_path=path);
    if len(imgs) != 1: return False
    img = imgs[0]

    img.trade = trade 
    img.save()
    return True

